import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
import { WorkspaceStatus } from '../../../types/enums';

export class UpdateWorkspaceDto {
  @ApiProperty({
    description: '工作区名称',
    example: '产品研发部门工作区',
    maxLength: 100,
    required: false,
  })
  @IsOptional()
  @IsString({ message: '工作区名称必须是字符串' })
  @MaxLength(100, { message: '工作区名称不能超过100个字符' })
  name?: string;

  @ApiProperty({
    description: '工作区描述',
    example: '这是产品研发部门的工作区，用于管理所有研发项目',
    required: false,
  })
  @IsOptional()
  @IsString({ message: '工作区描述必须是字符串' })
  description?: string;
  
  @ApiProperty({
    description: '工作区状态',
    enum: WorkspaceStatus,
    example: WorkspaceStatus.ACTIVE,
    required: false,
  })
  @IsOptional()
  @IsEnum(WorkspaceStatus, { message: '工作区状态无效' })
  status?: WorkspaceStatus;
} 